<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>2.v-for遍历对象和字符串</title>
        <!-- 引入Vue -->
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 准备好一个容器-->
        <div id="demo">
            <h2>v-for遍历对象</h2>
            <ul>
                <li v-for='(val,key,index) in car'>
                    {{index}}--{{key}}--{{val}}
                </li>
            </ul>
            <hr>
            <h2>v-for遍历字符串</h2>
            <ul>
                <li v-for='(index,val) in msg'>
                    {{index}}--{{val}}
                </li>
            </ul>
            <hr>
            <h2>v-for遍历指定次数</h2>
            <ul>
                <li v-for='(index,num) in 10'>
                   {{index}}--{{num}}
                </li>
            </ul>
        </div>
    </body>

    <script type="text/javascript">
        //阻止 vue 在启动时生成生产提示。
        Vue.config.productionTip = false
        new Vue({
			el:'#demo',
			data:{
				car:{
					name:'迈腾',
					price:'20W'
				},
				msg:'hello,atguigu'
			}
		})
    </script>
</html>